# -*- encoding: utf-8 -*-

class Afc (object):

    """ Classe définissant une instruction MOV Ra #Val. """

    def __init__ (self, ra, val, mem):
        self.__ra = ra 
        self.__val = val
        self.__mem = mem

    def do (self):
        self.__mem.setRegister(
            num = self.__ra,
            newVal = self.__val
            )

    def __str__ (self):
        return "afc r{0:d} #{1:d}".format(self.__ra, self.__val)
    
    def __unicode__ (self):
        return str(self)
